package com.dgut.courses_selecting_sys.mapper;

import com.dgut.courses_selecting_sys.dto.UserCourseListDto;
import com.dgut.courses_selecting_sys.entity.UserActivities;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yuec
 * @since 2021-01-30
 */
@Repository
@Mapper
public interface UserActivitiesMapper extends BaseMapper<UserActivities> {

    @Select("select LAST_INSERT_ID()")
    Long selectLastInsert();

    List<UserCourseListDto> listByActivityId(@Param("activityId") int activityId);

}
